var a = getApp();

Page({
    data: {
        item: "",
        balanceLang: "余额",
        log_model: ""
    },
    onLoad: function(a) {
        if ("store" == a.name) this.setData({
            id: a.id
        }), this.getData(); else {
            a.item && this.setData({
                item: JSON.parse(a.item)
            });
            try {
                var t = wx.getStorageSync("balance");
                t && (this.setData({
                    balanceLang: t
                }), wx.setNavigationBarTitle({
                    title: this.data.balanceLang + "详情"
                }));
            } catch (a) {}
        }
    },
    getData: function() {
        var t = this, e = a.getNetAddresss("plugin.store-cashier.frontend.store.balance.log.detail");
        a._postNetWork({
            url: e,
            data: {
                log_id: this.data.id
            },
            success: function(a) {
                var e = a.data;
                console.log(e);
                var n = e.data.log_model, o = {
                    serial_number: n.sn,
                    change_money: "".concat(n.op).concat(n.change_balance),
                    service_type_name: n.mold_name,
                    new_money: n.after_balance
                };
                t.setData({
                    item: o
                });
            },
            fail: function(a) {
                wx.showToast({
                    title: a.data.msg,
                    duration: 1e3,
                    icon: "none"
                });
            }
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});